package com.ustc.hewei.nettyrpc2_0.common.mock;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author hewei
 * @version 1.0
 * @description: 多个服务的默认实现类
 * @date 2022/10/28 10:58
 */

public class MultiMock {
    Map<String, MockInterface> mocks;

    public MultiMock() {
        mocks = new ConcurrentHashMap<>();
    }

    public void add(String serviceName, MockInterface mock) {
        mocks.put(serviceName, mock);
    }

    public MockInterface getMock(String serviceName) {
        return mocks.get(serviceName);
    }
}
